<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/4/17
  Time: 11:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>Title</title>
    <!--
        ${pageContext.request.contextPath}  -> /web_project_war_exploded
    -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-6 col-xs-push-3 edit-panel">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">编辑用户</h3>
                </div>
                <div class="panel-body">
                    <form action="people" method="post">
                        <!--
                            type为hidden的时候，那么该input输入依然为表单的数据，但是不展示.
                            但是提交的时候，还是会作为表单的数据提交：
                            people?id=34&name=zhangs&gedner=F
                         -->
                        <input type="hidden" name="id" value="${requestScope.people.id}">
                        <input type="hidden" name="method" value="edit">
                        <div class="form-group">
                            <label for="name">用户名:</label>
                            <input name="name" value="${requestScope.people.name}" autocomplete="off" id="name" class="form-control">
                        </div>
                        <div class="form-group">
                            <label for="gender">性　别:</label>
                            <select class="form-control" id="gender" name="gender">
                                <option <c:if test="${requestScope.people.gender == 'F'}">selected</c:if> value="F">女</option>
                                <option <c:if test="${requestScope.people.gender == 'M'}">selected</c:if> value="M">男</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="email">邮　件:</label>
                            <input value="${requestScope.people.email}" name="email" autocomplete="off" id="email" class="form-control">
                        </div>
                        <div class="form-group">
                            <label for="birthday">生　日:</label>
                            <input name="birthday"
                                   value="<fmt:formatDate value='${requestScope.people.birthday}' pattern='yyyy-MM-dd'></fmt:formatDate>"
                                   id="birthday" autocomplete="off" id="birthday" class="form-control">
                        </div>
                        <div class="form-group">
                            <!-- update people set name = ?, gender = ? where id = ? -->
                            <button class="btn btn-block btn-success">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
